import React from 'react'
import { NavBar, Icon } from 'antd-mobile';
import axios from 'axios'
import {DetailsWrap,Subh1,Subh3} from './StyleHomePage'
import List_1 from '@a/images/recommend/list_1.png'


 const Wxpay = props => {

    const handleClick = () => {
        axios.post('http://walter666.cn:8080/wxpay/prepay',{
            out_trade_no:new Date().getTime(),
            total_fee:'1',
            body:'学习课程',
            url:'http://localhost:3000/paysucc'
        })
        .then(result => {
            // console.log(result);
            document.write(result.data)
        })
    }

    return (
        <div>
            <NavBar
                mode="dark"
                icon={<Icon type="left" />}
                onLeftClick={() => props.history.goBack()}
                
            >课程详情</NavBar>
            <DetailsWrap>
                <div className="con">
                    <div className="img">
                        <img src={`${List_1}`} alt=""/>
                    </div>
                    <div className="title">
                        <Subh1>拿着作业欢天喜地过大年</Subh1>
                        <Subh3>5555人已参加 | 5555人已参加</Subh3>
                    </div>
                </div>
                <span onClick={handleClick}>购买课程</span>
            </DetailsWrap>
        </div>
    )
}
export default Wxpay